Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
I get "no exported member" when importing a function

I have a node/typescript application which I'm trying to import a function from another file. To export it I used exports.coolFunc = coolFunc and to import I used import {coolFunc} from '../controller/coolStuff'.

When I do that I get

Module '"../controller/coolFunc"' has no exported member 'coolFunc'

What am I doing wrong and how can I fix it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The import is an ES6 import. exports.coolFunc = coolFunc is wrong. It's a CommonJS export. The equivalent ES6 export is

export { coolFunc }

or

export function coolFunc...

Here you can read more about the syntax of ES6 export.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!